﻿   <script src="~/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
@*   <script src="~/Scripts/jquery.easyui.js" type="text/javascript"></script>*@
    <script src="~/Scripts/SwfUpload/swfupload.js" type="text/javascript"></script>
    <script src="~/Scripts/SwfUpload/plugins/swfupload.queue.js" type="text/javascript"></script>
    <script src="~/Scripts/SwfUpload/plugins/swfupload.speed.js" type="text/javascript"></script>
        
   <script type="text/javascript">
       var swfu;
       $(function () { 
       swfu = new SWFUpload({
           upload_url: "/Common/Swfupload",
           flash_url: "/Scripts/SwfUpload/Flash/swfupload.swf",
           file_size_limit: "1500 MB",
           file_types: "*.*",
           file_types_description: "All Files",
           file_upload_limit: 0,
           file_queue_limit: 1,
           debug: false,
           // Button settings
           button_image_url: "",
           button_width: "50",
           button_height: "25",
           button_placeholder_id: "spanButtonPlaceHolder",
           button_text: '<span >浏览</span>',
           button_text_style: ".theFont { font-size: 12; }",
           button_text_left_padding: 12,
           button_text_top_padding: 3,
           file_dialog_complete_handler: function (numFilesSelected, numFilesQueued) {
           },
           file_queued_handler: function (file) {
               $("#fileName").val(file.name);
           },
           upload_progress_handler: function (file, complete, total) {

           },
           upload_success_handler: function (file, data) {
               var res = eval("(" + data + ")");
               if (res.Result) {
                   alert(res.Message);
               }
               else {
                   alert(res.Exception);
               }
               $("#btnSubmit").html("上传");
           }
       });
       $("#btnSubmit").click(function () {
           if (swfu.getStats().files_queued > 0) {
               $("#btnSubmit").html("处理中...");
               swfu.startUpload();
           }
           else {
               alert("请选择文件");
               //$.messager.alert('提示', '请选择文件！');
           }
       });

       $("#cancelButton").click(function () {
           swfu.stopUpload();
       });
       });
     </script>


<fieldset style="height:65px">
    <legend>选择excel</legend>
    <div>
        <input type="text" id="fileName" />
        <span id="spanButtonPlaceHolder">浏览</span>
        <button id="btnSubmit">上传</button>
    </div>
    <div id="importDiv">
        <label id="resfileName"></label>
    </div>
</fieldset>


